#pragma once

#include <render/Others/PerseusLibDefines.h>

#include <stdio.h>
#include <string>
#include <vector>
#include <math.h>

namespace pwp {

class Camera3D {
public:
  VFLOAT focalLength[2];
  VFLOAT centerPoint[2];

public:
  VFLOAT SizeX;
  VFLOAT SizeY;
  VFLOAT K[3][4];

  std::string CameraName;

  Camera3D(float fSizeX, float fSizeY, float fFocalLengthX,
           float fFocalLengthY, float fCenterPointX, float fCenterPointY)
  {
    int i, j;

    SizeX = fSizeX;
    SizeY = fSizeY;
    focalLength[0] = fFocalLengthX;
    focalLength[1] = fFocalLengthY;
    centerPoint[0] = fCenterPointX;
    centerPoint[1] = fCenterPointY;

    for (i = 0; i < 3; i++) for (j = 0; j < 4; j++) K[i][j] = 0;

    K[0][0] = focalLength[0]; K[1][1] = focalLength[1];
    K[0][2] = centerPoint[0]; K[1][2] = centerPoint[1];
    K[2][2] = 1;

    for (i = 0; i < 4; i++)
      K[1][i] = (SizeY - 1) * (K[2][i]) - K[1][i];
  }


  ~Camera3D(void) { }
};
}
